package com.nervenets.web.hibernate.domain.statistics;

import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;

@Entity
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StatisticsOfOrder extends DomainObject {
    private int total;
    private int money;
    private int firstTime;
    private int finished;
    private int cancel;

    public void add(StatisticsOfOrder count) {
        this.total += count.getTotal();
        this.money += count.getMoney();
        this.firstTime += count.getFirstTime();
        this.finished += count.getFinished();
        this.cancel += count.getCancel();
    }
}
